#ifndef GEOMETRY_GENERATOR_H
#define GEOMETRY_GENERATOR_H

#include <stdint.h>

#include <iostream>

namespace Ogre
{
    class Vector3;
    class SceneManager;
    class Camera;
};

class MaterialDictionary;
class PlantDictionary;

class GeometryGenerator
{
public:
    enum TileType
    {
        EMPTY,
        FLOOR,
        BOULDER,
        PEBBLES,
        WALL,
        FORTIFICATION,
        STAIR_UP,
        STAIR_DOWN,
        STAIR_UPDOWN,
        RAMP,
        RAMP_TOP,
        BROOK_BED,
        BROOK_TOP,
        TREE,
        SAPLING,
        SHRUB,
        ENDLESS_PIT
    };
    enum LiquidType
    {
        WATER,
        MAGMA
    };
    enum TileMaterialType
    {
        NONE=-1,
        AIR,
        SOIL,
        STONE,
        FEATURE,
        LAVA_STONE,
        MINERAL,
        FROZEN_LIQUID,
        CONSTRUCTION,
        GRASS_LIGHT,
        GRASS_DARK,
        GRASS_DRY,
        GRASS_DEAD,
        HFS,
        CAMPFIRE,
        FIRE,
        ASHES,
        MAGMA_TYPE,
        DRIFTWOOD,
        POOL,
        BROOK,
        RIVER
    };
    GeometryGenerator() {}
    virtual ~GeometryGenerator() {}
    virtual void setMapSize(uint32_t x, uint32_t y, uint32_t z)=0;
    virtual void setTile(uint32_t x, uint32_t y, uint32_t z, TileType tile_type, TileMaterialType tile_material=NONE, uint32_t material_index=0, uint16_t material_type=0)=0;
    virtual void addLiquid(uint32_t x, uint32_t y, uint32_t z, LiquidType liquid_type, uint16_t flow_size)=0;
    virtual void addTree(uint32_t x, uint32_t y, uint32_t z, uint32_t material, bool is_shrub)=0;
    virtual void notifyCameraPosition(Ogre::Vector3 camPos)=0;
    virtual void update(double timeSinceLastFrame)=0;
    virtual void prepareScene()=0;
    virtual void setCamera(Ogre::Camera *c) {cam = c;}
    virtual Ogre::Vector3 getInitialCameraPosition()=0;
    virtual Ogre::SceneManager* getSceneManager() {return smgr;}
    virtual void setMaterialDictionary(MaterialDictionary *md) {materialDictionary = md;}
    virtual void setPlantDictionary(PlantDictionary *pd) {plantDictionary = pd;}
protected:
    Ogre::SceneManager *smgr;
    Ogre::Camera *cam;
    MaterialDictionary *materialDictionary;
    PlantDictionary *plantDictionary;
};

#endif
